#include <stdio.h>
#include<stdint.h>
#include"ListHandel/listhandel.h"
typedef struct bits{
  unsigned _0:1;
  unsigned _2:1;
  unsigned _3:1;
  unsigned _4:1;
  unsigned _5:1;
  unsigned _6:1;
  unsigned _7:1;
}bits;

typedef struct SDA{
  int data;
  uint8_t flag[20];
}SDA;
int outfun(DATA data,const void *arg)
{
  arg=arg;
  SDA *tmp=NULL;
  bits *bit=NULL;
  tmp=(SDA *)data;
  bit=(bits *)&(tmp->flag[tmp->data]);
  printf("DATA=%d   bit=%d\n",tmp->data,bit->_0);
  return 0;
}

int main(int argc, char *argv[])
{
  SDA da;
  HEAD head=initList(sizeof(SDA));
  for (int i = 0; i < 10; ++i) {
      da.data=i;
      da.flag[i]=1;
     printf("addData=%d\n", addData(head,&da));
    }
  printf("outData=%d\n", outData(head,outfun));
  freeList(head);
    return 0;
}
